<template>
	<view>
	<view style="margin: 30rpx;" v-for="p in parkingRecordList">
		<view class="recorditem">
			<text>进场时间: {{p.inTime}}</text>
		</view>
		<view class="recorditem">
			<text>离场时间: {{p.outTime}}</text>
		</view>
		<view class="recorditem">
			<text>停车费用: {{p.parkingFee}}</text>
		</view>
		<view class="recorditem">
			<text>停车状态: {{p.statusName}}</text>
		</view>
	</view>
</view>
</template>

<script>
	import{parkingrecordurl} from '../../common/api.js'
	export default {
		data() {
			return {
				parkingRecordList:[]
			}
		},
		onShow(){
			this.getParkingRecord()
		},
		methods: {
			getParkingRecord()
			{
				let jwt = uni.getStorageSync('jwt');
				uni.request({
					url: parkingrecordurl,
					header: {
						'jwt': jwt
					},
					success: (res) => {
				
						let result = res.data;
						console.log(result);
						if(result.status==0)
						{
							this.parkingRecordList=result.data;
						}
						else
						{
							console.log("获取记录失败");
						}
						
				
					},
					fail: () => {
						console.log("网络异常");
					}
				})
			}
		}
	}
</script>

<style>
	.recorditem{
		background-color: #FFFFFF;
		padding: 10rpx;
		margin-top: 3rpx;
	}

</style>
